package org.fuys.coder.domain.search.model.vo;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.domain.search.model.vo
 * @className: SearchTypeVO
 * @author: WangJing
 * @description: 用于判断前端请求类型和对应返回key信息的VO 这里采用Map而非枚举是为了之后的查找类型的可拓展性
 * @date: 2024/8/15 17:12
 * @version: 1.0
 */
public class SearchTypeVO {
    private static Map<Integer,String> searchTypeMap=new ConcurrentHashMap<>();

    public static final Integer SUBSTANCE=1;
    public static final Integer AUTHOR=2;
    public static final Integer CATEGORY=4;
    public static final Integer MAX_VALUE=7;

    static{
        searchTypeMap.put(1,"substance");
        searchTypeMap.put(2,"author");
        searchTypeMap.put(4,"category");
    }

    public static void putType(Integer type,String desc){
        searchTypeMap.put(type,desc);
    }

    public static String getType(Integer type){
        return searchTypeMap.get(type);
    }

}
